com.supermap.ar.areffect.preset

Class BaseShape

  • java.lang.Object
    • com.supermap.ar.areffect.preset.BaseShape
  • Direct Known Subclasses:
    ARGeometry, Shape


    public class BaseShape
    extends java.lang.Object
    Base shape class Point, line, region
    • Constructor Detail

      • BaseShape

        public BaseShape(BaseShape.MatType matType)
        Construction method
        Parameters:
        matType - texture type (transparent/opaque)
    • Method Detail

      • getSelectionColor

        public Color getSelectionColor()
        Gets the rendering object under the selection status
        Returns:
      • setSelectionColor

        public void setSelectionColor(Color color)
        Sets the color of the rendering object under the selection status
        Parameters:
        color -
      • isSelected

        public boolean isSelected()
        Determines whether it is selected
        Returns:
      • select

        public void select()
        Selected
      • unSelect

        public void unSelect()
        Cancel the selected status
      • getRadius

        public float getRadius()
      • setRadius

        public void setRadius(float radius)
      • getTextureMap

        public int getTextureMap()
        Gets the resource id of the texture map
        Returns:
      • setTextureMap

        public BaseShape setTextureMap(int textureMap)
        Sets images
        Parameters:
        textureMap -
        Returns:
      • isShadowReceiver

        public boolean isShadowReceiver()
        Whether the rendered shape accepts shadow
        Returns:
      • setShadowReceiver

        public BaseShape setShadowReceiver(boolean shadowReceiver)
        Sets the effect after accepting shadow
        Parameters:
        shadowReceiver -
        Returns:
      • isShadowCaster

        public boolean isShadowCaster()
        Whether the rendered shape can generate shadow
        Returns:
      • setShadowCaster

        public BaseShape setShadowCaster(boolean shadowCaster)
        Sets whether to generate the shadow effect
        Parameters:
        shadowCaster -
        Returns:
      • getMetallic

        public float getMetallic()
        Gets metallicity
        Returns:
      • setMetallic

        public BaseShape setMetallic(float metallic)
        Sets metallicity
        Parameters:
        metallic -
        Returns:
      • getRoughness

        public float getRoughness()
        Gets roughness
        Returns:
      • setRoughness

        public BaseShape setRoughness(float roughness)
        Sets roughness
        Parameters:
        roughness -
        Returns:
      • getReflectance

        public float getReflectance()
        Gets reflectance
        Returns:
      • setReflectance

        public BaseShape setReflectance(float reflectance)
        Sets reflectance
        Parameters:
        reflectance -
        Returns:
      • getColorRGBA

        public float[] getColorRGBA()
        Gets the RGBA value of the color
      • getColor

        public Color getColor()
        Gets the color
        Returns:
      • setColor

        public BaseShape setColor(java.lang.String colorString)
        Sets the color
        Parameters:
        colorString - color string, eg: "#ffffff"
        Returns:
      • setColor

        public void setColor(Color color)
        Sets the color
        Parameters:
        color -
      • setColor

        public BaseShape setColor(float r,
                                  float g,
                                  float b,
                                  float a)
        Sets the color through its RGBA value
        Parameters:
        r -
        g -
        b -
        a -
        Returns:
      • updateMaterial

        public void updateMaterial()
        Update texture
      • clear

        public void clear()
        Clear shape
      • setShapeStyle

        public void setShapeStyle(ShapeStyle shapeStyle)
        Set style style
        Parameters:
        shapeStyle - shape风格
      • getShapeMaterial

        public Material getShapeMaterial()
      • isRenderable

        public boolean isRenderable()
        Renderable or not

        default true

        Returns:
        boolean
      • setRenderable

        public S setRenderable(boolean renderable)
        Sets whether the object is renderable

        Defaults to true, when set to false, the object drawn will not be rendered in the scene

        Parameters:
        renderable - boolean
      • setParentNode

        public void setParentNode(AREffectElement element)
        Setting the parent node
        Parameters:
        element -
      • setParentNode

        public void setParentNode(EffectView arView)
        Setting the parent node
        Parameters:
        arView -
      • getParentElement

        public AREffectElement getParentElement()
        Get the parent node
        Returns: